<template>
  <div class="ma-content-block p-4">
    <ma-crud :options="crud" :columns="columns" ref="crudRef">
      <template #tableAfterButtons>
        <a-button
            @click="openCate"
            type="outline"
            status="success"
        ><template #icon><icon-apps /> </template>批量结转</a-button>

        <a-button
            @click="openCate"
            type="outline"
            status="success"
        ><template #icon><icon-apps /> </template>批量结算</a-button>

      </template>

      <template #logo_path="{ record }">
        <a-image :src="record.logo_path ? $tool.showFile(record.logo_path):''" height="80" />
      </template>

    </ma-crud>

  </div>
</template>

<script setup>
import {ref, reactive, onMounted} from 'vue'

import api from '@/api/prm/tbk_order.js'
import { Message } from '@arco-design/web-vue'

const crudRef = ref()


//表格
const crud = reactive({
  api: api.list,
  showIndex: false,
  // pageLayout: 'fixed',
  showTools:false,
  // tablePagination:true,
  rowSelection: {showCheckedAll: true},
  operationColumn: true,
  operationColumnWidth: 180,
  searchColNumber:3,
  add: {show: false, api: api.add, auth: ['prm:tbk_order:save']},
  edit: {show: false, api: api.update, auth: ['prm:tbk_order:update']},
  delete: {show: false, api: api.delete, auth: ['prm:tbk_order:delete'],},
  formOption: {viewType: 'drawer', width: 800},
})

const columns = reactive([
  {title: 'ID', dataIndex: 'id', addDisplay: false, editDisplay: false, width: 50, hide: true},
  {title: '渠道', dataIndex: 'act_name', formType: 'input', search: true, width: 80,},
  {title: '平台', dataIndex: 'act_id', search: false, },
  {title: '平台单号', dataIndex: 'jtk_share_fee', search: true, width: 200},
  {title: '总佣金', dataIndex: 'jtk_share_rate', search: true, width: 200},
  {title: '平台状态', dataIndex: 'order_sn', search: true, width: 200},
  {title: '平台状态', dataIndex: 'status_desc', search: true, width: 200},
  {title: '结转状态', dataIndex: 'trans_status', search: true, width: 200},
  {title: '结转描述', dataIndex: 'trans_remark', search: false, width: 200},
  {
    title: '下单时间', dataIndex: 'created_at', addDisplay: false, editDisplay: false,
    search: false, formType: 'range', width: 180
  },
  {
    title: '更新时间', dataIndex: 'updated_at', addDisplay: false, editDisplay: false,
    search: false, formType: 'range', width: 180
  }])

</script>

<script>
export default {name: 'prm:tbk_order'}
</script>

<style scoped>

</style>
